package com.smh.a01GenericsDemo1;

import java.util.ArrayList;

public class GenericsDemo4 {
    public static void main(String[] args) {

        ArrayList<Ye> arrayList = new ArrayList<>();
        ArrayList<Fu> arrayList2 = new ArrayList<>();
        ArrayList<Zi> arrayList3= new ArrayList<>();

        //泛型不具备,但是数据具备继承性
        //不具备继承性
        method(arrayList);
//        method(arrayList2);
//        method(arrayList3);
//        但是数据具备继承性
        arrayList.add(new Fu());
        arrayList.add(new Zi());

    }
    public static void method(ArrayList<Ye> list){

    }
}
class Ye{

}
class Fu extends Ye{

}
class Zi extends Fu{

}
